INSERT INTO c1_user (
USER_ID,
USER_CODE,
ID_CARD_NO,
NAME,
PASSWORD_,
DEPARTMENT_CODE,
TELEPHONE,
BIRTHDAY,
SEX_CODE,
LOCUS
)
(
SELECT
u.ID,
u.USER_CODE,
u.ID_CODE,
u.USER_NAME,
u.PASSWORD,
REPLACE(u.DEPT_CODE, 'root','') AS DEPT_CODE ,
u.PHONE_NUM,
u.BIRTHDAY,
u.SEX,
u.ADDRESS
FROM  t_user u
WHERE NOT EXISTS
(SELECT
1
FROM
c1_user e
WHERE e.`USER_CODE` = u.`USER_CODE`  OR e.USER_ID = u.ID )
)